#include <stdio.h>
// 取出数组中之值最大的元素

int main()
{
  int arr[] = {9, 12, 4, 5, 100, 75, 62, 21, 99};
  int all_length = sizeof arr;
  int length = sizeof arr[0];
  int num = all_length / length;
  int MAX=arr[0], MIN=arr[0];

  for (int i = 1; i < num; i++)
  {
    if (MAX < arr[i])
    {
      MAX = arr[i];
    }
    if (MIN > arr[i])
    {
      MIN = arr[i];
    }
  }
  printf("该数组里的最大值为%d\n", MAX);
  printf("该数组里的最小值为%d\n", MIN);
  return 0;
}